// proxy.h : Declaration of the Cproxy

#ifndef __PROXY_H_
#define __PROXY_H_

#include "resource.h"       // main symbols
#include "ExDisp.h"
/////////////////////////////////////////////////////////////////////////////
// Cproxy
class ATL_NO_VTABLE Cproxy : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<Cproxy, &CLSID_proxy>,
	public IObjectWithSiteImpl<Cproxy>,
	public IDispatchImpl<Iproxy, &IID_Iproxy, &LIBID_IEBHOLib>
{
public:
	Cproxy()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_PROXY)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(Cproxy)
	COM_INTERFACE_ENTRY(Iproxy)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(IObjectWithSite)
END_COM_MAP()

// Iproxy
public:
	void dir();
	void file();
	void checkurl(char* inurl,char* outurl,int size);
	void log(char * s);
	CComQIPtr<IWebBrowser2, &IID_IWebBrowser2> mWebBrowser2;
	DWORD       mCookie;   // Connection Token

	STDMETHOD(SetSite)(IUnknown *pUnkSite);
	HRESULT RegisterEventHandler(BOOL inAdvise);

	STDMETHOD(Invoke)(DISPID dispidMember,REFIID riid, LCID lcid, WORD wFlags,
                     DISPPARAMS * pDispParams, VARIANT * pvarResult,
                     EXCEPINFO * pexcepinfo, UINT * puArgErr);
private:
	void getpath(TCHAR* path,unsigned long * size);
};

#endif //__PROXY_H_
